package com.bytz.modules.cms.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bytz.modules.cms.product.entity.EcProduct;
import com.bytz.modules.cms.product.model.EcProductModel;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 莱宝CMS—产品管理—EC产品导入信息表 服务类
 * </p>
 *
 * @author KyleWang
 * @since 2022-10-10
 */
public interface IEcProductService extends IService<EcProduct> {

    /**
     * 根据商品编码查找
     */
    Set<String> getByProductNumbers(Collection<String> productIds);

    /**
     * 分页查询
     */
    IPage<EcProductModel> queryPage(Page<EcProduct> page, EcProductModel ecProductModel, Map<String, String[]> requestParams) throws Exception;

    /**
     * 导入ec商品
     */
    Boolean mergeDb(List<EcProduct> ecProductList);

    /**
     * 导出ec产品清单
     */
    void export(HttpServletResponse response) throws IOException;

    /**
     * 保存单条
     */
    void saveEcProduct(EcProduct ecProduct);

    /**
     * 删除一条
     */
    Boolean removeEcById(String productNumber);
}
